package practices;

import java.io.File;
import java.util.Scanner;

public class ExceptionDemo {
    public static void readFile(String filePath) throws FileNotFoundException, java.io.FileNotFoundException {
        Scanner sc = new Scanner(new File(filePath));
        while (sc.hasNextLine()) {
            System.out.println(sc.nextLine());
        }
        sc.close();
    }
    public static void printString(String str) {
        System.out.println(str.length());
    }
    public static void main(String[] args) {
       try {
           readFile("example.txt");
       }catch (FileNotFoundException | java.io.FileNotFoundException e) {
           System.out.println("File not found");
       }
       printString("null");
    }
}
